﻿using System;

namespace test
{
    // 定义一个类型的女人，王婆和潘金莲都属于这种女人
    public interface KindWomen
    {
        void makeEyesWithMan(); //抛媚眼
        void happyWithMan(); // 做爱
    }

    public class PanJinLian : KindWomen
    {
        public void happyWithMan()
        {
            Console.WriteLine("潘金莲和男人做爱");
        }
        public void makeEyesWithMan()
        {
            Console.WriteLine("潘金莲抛媚眼");
        }
    }

    public class WangPo : KindWomen
    {
        private KindWomen kindwomen;

        public WangPo()  // 默认，王婆是潘金莲的代理
        {
            this.kindwomen = new PanJinLian();
        }

        public WangPo(KindWomen kindwomen) // 王婆可以作为任意一种类型的女人的代理
        {
            this.kindwomen = kindwomen;
        }

        public void happyWithMan()  // 让代理人执行动作
        {
            this.kindwomen.happyWithMan();
        }
        public void makeEyesWithMan()
        {
            this.kindwomen.makeEyesWithMan();
        }
    }



}
